#ifndef SESSION_H
#define SESSION_H

#include <chrono>
#include <memory>

#include "common/elements/user.h"
#include "common/more/uuid.h"

class Session final
{
public:
    explicit Session(Elements::UserPtr user);
    ~Session();

    Uuids::Uuid uuid() const;
    bool checkDuration() const;
    Elements::UserPtr user() const;

    void keepAlive();

private:
    Uuids::Uuid m_uuid;
    unsigned m_availableDuration = 0;
    std::chrono::time_point<std::chrono::system_clock> m_lastActionTime;
    Elements::UserPtr m_user;
};

#endif // SESSION_H
